import Vue from 'vue'
import App from './App'
import store from './store'
import router from './router'
import reg from '@/plugins/reg.js'
import * as echarts from 'echarts';
import importFile from '@/components/importFile'
import testyjf from '@/components/test.vue'
Vue.component('import-file', importFile)
Vue.component('yjf', testyjf)
import './plugins/axios'
import './plugins/element'

import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/styles/index.scss'


import '@/icons' // icon
import '@/permission' // permission control

Vue.config.productionTip = false
Vue.prototype.$store = store;
Vue.prototype.$echarts = echarts;
Vue.prototype.$reg = reg;
Vue.prototype.$Url = process.env.VUE_APP_apiUrl
// Vue.prototype.$Url ='http://119.45.161.250:8088'
Vue.prototype.$download = (filename, link) => {
  let DownloadLink = document.createElement('a'); 
  DownloadLink.style = 'display: none'; // 创建一个隐藏的a标签
  DownloadLink.download = filename;
  DownloadLink.href = link;
  document.body.appendChild(DownloadLink);
  DownloadLink.click(); // 触发a标签的click事件
  document.body.removeChild(DownloadLink);
}
Vue.prototype.$downloadBlob = (fileName, res) => {
  const blob = new Blob([res])
  let url = window.URL.createObjectURL(blob)
  let DownloadLink = document.createElement('a'); 
  DownloadLink.style = 'display: none'; // 创建一个隐藏的a标签
  DownloadLink.download = fileName;
  DownloadLink.href = url;
  document.body.appendChild(DownloadLink);
  DownloadLink.click(); // 触发a标签的click事件
  document.body.removeChild(DownloadLink);
}
new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
